package com.lzk.工厂模式.抽象工厂.order;

import com.lzk.工厂模式.抽象工厂.pizza.BJCheesePizza;
import com.lzk.工厂模式.抽象工厂.pizza.BJPepperPizza;
import com.lzk.工厂模式.抽象工厂.pizza.Pizza;

/**
 * author: 刘中魁
 */
//这是工厂子类
public class BJFactory implements AbsFactory {
    @Override
    public Pizza createPizza(String orderType) {
        System.out.println("使用的抽象工厂模式");
        Pizza pizza = null;
        if (orderType.equals("cheese")){
            pizza = new BJCheesePizza();
        }else if (orderType.equals("pepper")){
            pizza = new BJPepperPizza();
        }
        return pizza;
    }
}
